import { asyncExecFunction } from "@/king-components/js/KingonPlus";
import { getDeviceConfig } from "@/common/devices-config";


export const HnXfjNfcInit = async () => {
  // 初始化
  try {
    const result = await asyncExecFunction("HnXfjPortInit", getDeviceConfig("nfc").params);
    const data = JSON.parse(result);
    if (data.Action == "OnCardreaded") {
      return { state: true, data };
    } else {
      return { state: false, data };
    }
  } catch (error) {
    console.error(error);
    // uni.showToast({ title: error.message, icon: "none" });
    uni.showModal({ title: "提示", content: error.message });
    return { state: false, error };
  }
}